<!DOCTYPE html>
<html lang="cn">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>object</title>
    <style>
        .test {
            width: 200px;
            height: 100px;
        }
    </style>
</head>

<body>

</body>

</html>
<script>
    let age = 18; //声明字段
    let arr = ['aa', 'bb', 'cc']; //声明数组
    let zhangSan = {
            leg: 2,
            figer: 10,
            color: 'yellow',
            tools: function() {
                document.write("会使用工具方法");
            },
            'first-Name': 'zhang',
            str: ['abc', 'efg', 'hij']
        } //声明对象
    zhangSan.age = 18;
    zhangSan.figer = 9;
    document.write(zhangSan.leg);
    document.write(zhangSan.figer);
    document.write(zhangSan.age);
    delete zhangSan.leg;
    document.write("删除对象属性后还有没有" + zhangSan.leg);

    //         请声明一个产品对象，里面包如下信息：
    // 要求：
    // 商品对象名字： goods
    // 商品名称命名为： name
    // 商品编号： num
    // 商品毛重： weight
    // 商品产地： address


    let goods = {
        name: 'huawei',
        num: 337845818,
        weight: '199g',
        address: 'China'
    }
    goods.name = 'huawei mate70RS';
    document.write(goods.name + "编号" + goods.num + "重量" + goods.weight + "产地" + goods.address);
    goods.color = 'pink';
    document.write(goods.color);
    delete goods.address;
    document.write("删除后" + goods.address);
</script>